<template>
  <div id="app">
    <MyHeader/>
    <button @click="getComponents">获取组件的ref</button>
    <hr/>
    <Count ref="countVue"/>
    <hr/>
    <Count/>
    <br/>

  </div>
</template>

<script>
import MyHeader from "@/components/MyHeader";
import Count from "@/components/Count";

export default {
  name: 'App',
  components: {
    MyHeader,
    Count,
  },
  data(){
    return {
      person:{
        name:"wdh",
        age:18,
        hobby:'anime'
      },
      hot:true
    }
  },
  methods:{
    getComponents(){
      console.log(this.$refs)
      console.log(this.$refs.countVue)
      console.log(this.$refs.countVue.$refs.countHead)
    }
  }
}
</script>

<style>

</style>
